<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";	
%>
<html>
<head>
<base href="<%=basePath %>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加菜单</title>
<jsp:include page="../../../common/easyui-css.inc" flush="true"/>
</head>
<body>
<form name="saveForm" id="saveForm" method="post">  
  <table width="99%" class="adminlist" id="authrosTable">
   <tr height="25">
      <th width="40">菜单名称</th>
	  <th width="50" align="left">功能名称</th>	 
	  <th width="200">功能权限</th>	  	  	    
   </tr>
   <c:if test="${empty menus}">
      <tr>	 
	    <td colspan="6" height="25" style="text-align: center;color: red;font-size: 14px;">
	       暂无对应的功能信息
	    </td>	      
    </tr>
  </c:if>
  <c:if test="${not empty menus}">
     <c:forEach items="${menus}" var="pmenu" varStatus="pstatus">
         <c:forEach items="${pmenu.childrens}" var="cmenu" varStatus="cstatus">         
	         <tr>	 
			    <td style="text-align:right;font-size: 13px;">${pmenu.mname }</td>
			    <td style="text-align:right;font-size: 13px;">
			    	${cmenu.mname }
			    	<input type="checkbox" name="listCmenu" id="cmenu ${cmenu.mid }" value="${cmenu.mid }"/>
			    </td>		   
			    <td style="font-size: 13px;padding-left: 10px;">
			    <c:forEach items="${cmenu.listoperates}" var="oper">
			        <input type="checkbox" name="listOperId" id="base_${oper.operId}" value="${oper.operId }"/>${oper.operatename }
			        (${(oper.opertype=='FUNTREE')?'<span style="color:red;">按钮</span>':'<span style="color:blue;">非按钮</span>' })
			    <input type="hidden" name="menuId_${oper.operId}" value="${cmenu.mid }"/>
			    <input type="hidden" name="systemId_${oper.operId }" value="${pmenu.mid }"/>
			    </c:forEach>			    
			    </td>		   
	         </tr>
        </c:forEach>
     </c:forEach>  
  </c:if>
 </table>  
	<input type="hidden" name="roleId" id="roleId" value="${roleId }"/>
	<input type="hidden" name="roleName" id="roleName" value="${roleName }"/> 
</form>
<div id="dlg-buttons" style="text-align: center;margin-top: 10px;margin-right: 20px;">
    <a id="menu_save_btn" href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-save">保存</a>  
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:parent.$('#authorWin').window('close')" iconcls="icon-cancel">取消</a> 
</div> 
<jsp:include page="../../../common/easyui-js.inc" flush="true"/>
<script type="text/javascript" src="pages/sys/role/listAuthors.js?v=<%=Math.random() %>"></script>
</body>
</html>
